package com.app.bimo.module_accounts.mvp.constract;



import com.app.bimo.commonbusiness.bean.BaseResult;
import com.app.bimo.commonbusiness.mvp.IModel;
import com.app.bimo.commonbusiness.mvp.IView;
import com.app.bimo.library_db.UserData;
import com.app.bimo.module_accounts.mvp.model.entiy.CodeHelpData;
import com.app.bimo.module_accounts.mvp.model.entiy.OtherResult;

import androidx.collection.ArrayMap;
import io.reactivex.Observable;

public class LoginContract {
    //对于经常使用的关于UI的方法可以定义到IView中,如显示隐藏进度条,和显示文字消息
    public interface View extends IView {
        void loginDataNotify(int type, OtherResult data);

        void getCodeDataNotify(Object data);

        void registerDataNotify(OtherResult data, String phoneNum);

        void getCodeError(String s);

        void showDialogLoading();

        void hideDialogLoading();

//        void userInfoNotify(UserData data);

        void getCodeHelp(CodeHelpData data);

    }

    //Model层定义接口,外部只需关心Model返回的数据,无需关心内部细节,如是否使用缓存
    public interface Model extends IModel {
        /**
         * int type, String openid, String unionid
         * , String nickname, String avatar, int sex
         *
         * @return
         */
        Observable<BaseResult<OtherResult>> login(ArrayMap<String, String> map);

        Observable<BaseResult<UserData>> getUserInfo();

        Observable<BaseResult<Object>> getCode(String mobile, int type);

        Observable<BaseResult<OtherResult>> phoneRegister(ArrayMap<String, String> map);

        Observable<BaseResult<CodeHelpData>> getCodeHelp();

    }
}
